<link rel="stylesheet" href="../addons/jy_creditshop/resource/css/common-new.css" />
<link rel="stylesheet" href="../addons/jy_creditshop/resource/css/common.css?v=2" />
<style type="text/css">
    .fui-navbar ~ .fui-content, .fui-content.navbar{padding-bottom:0;}
    {if $set['creditbalance']==0 && $pay['credit'] == 0}
    .fui-actionsheet a.balance{display: none;}
    {/if}
    {if $set['creditwechat']==0 && $pay['weixin'] == 0 && $pay['weixin_jie'] == 0}
    .fui-actionsheet a.wechat{display: none;}
    {/if}
    {if $set['creditalipay']==0 && $pay['alipay'] == 0}
    .fui-actionsheet a.alipay{display: none;}
    {/if}
    .text-danger2 {
        background: none;
    }
</style>
<div class='fui-page order-detail-page'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" href="javascript:;" ng-click="access_json('jy_weishop_cutprice/detail//id='+pagedata.post.actid)" ></a>
        </div>
        <div class="title">创建订单</div>
        <div class="fui-header-right"></div>
    </div>
    <div class='fui-content navbar'>
            <div class="fui-cell-group fui-cell-click">
			<div id="addressInfo" class="fui-cell-group fui-address-group" style="margin-top:0px">
				<div ng-if="pagedata.item.addressid" class="fui-cell">
					<div style="width:100%">
						<div class="fui-cell-text name bold" style="font-size:0.8rem">
							<span style="margin-right:20px">{{pagedata.item.address.name}}</span><span>{{pagedata.item.address.mobile}}</span>
						</div>
						<div class="fui-cell-text name" style="margin-top:5px">
							<!--预售完成-->
							<i class="fui-tag fui-tag-red">默认</i>
							<i class="fui-tag fui-tag-blue">家</i>
							{{pagedata.item.address.pcd.province+pagedata.item.address.pcd.city+pagedata.item.address.pcd.district+pagedata.item.address.address}}
						</div>
					</div>
					<div class="fui-cell-remark" ng-click="modal_func(pagedata.item,'address','core/member.address/')" ></div>
				</div>
				<div ng-if="!pagedata.item.addressid" class="fui-list-inner" ng-click="access_json('core/member.address/edit')">
						<div class="text no-address" ><i class="icon jinyunicon icon-tianjia"></i> 添加收货地址</div>
				</div>
			</div>               
            </div>
        <div class="fui-list-group goods-list-group">
            <a href="javascript:;" ng-click="access_json('jy_weishop_cutprice/detail//id='+pagedata.post.actid)" class="external">
                <div class="fui-list goods-list">
                    <div class="fui-list-media">
                        <img src="{{tomedia(pagedata.act.image)}}" alt="{{pagedata.goods.title}}" class="round" onerror="this.src='../addons/ewei_shopv2/static/images/nopic100.jpg'">
                    </div>
                    <div class="fui-list-inner">
                        <div class="text goodstitle">{{pagedata.act.goods.title}}</div>
                        <div ng-if="pagedata.optionid" class='subtitle' style="font-size:0.6rem;color:#999;">规格：{{pagedata.goods.optiontitle}}</div>
                    </div>
                    <div class='fui-list-angle'>
						<span class='marketprice'>
                            价格<br />&yen;{{pagedata.post.price}}
				            <br/>   x {{pagedata.post.num ||'1'}}
                        </span>
                    </div>
                </div>
            </a>
        </div>

        
        <script language='javascript' src='https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1'></script>
        <div class='fui-cell-group price-cell-group'>
            <div class="fui-cell">
                <div class="fui-cell-label">商品小计</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">&yen;{{pagedata.post.fee}}</div>
            </div>
        </div>
    </div>

    <div class='fui-footer fui-navbar order-create-checkout'>
        <p class="nav-item" style="width:10%;text-align: left;padding:0.3rem;font-size:0.7rem;">
            需付：
            <span class="text-danger2" style="background: none;">
          
                        <span class="moneydispatch">&yen;{{pagedata.post.fee}}</span>
                      
            </span>
        </p>
        <a href='javascript:;' ng-click="pagedata.pay()" class="nav-item btn btn-danger buybtn" id="openActionSheet">立即支付</a>
    </div>
	
<script>	
	scope.pagedata.pay=function(){
	var params={
		data:{'actid':scope.pagedata.post.actid,'addressid':scope.pagedata.item.addressid,'fee':scope.pagedata.post.fee,'num':scope.pagedata.post.num},
		op:'pay',
		callback:function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(re){
						if(re.type=='success'){
							scope.message('支付成功！','','jy_weishop_cutprice/order//status=1');
							
						}else{
							scope.message('支付失败！失败原因：'+re.message,'error');
						}
					});
				});
			}
		}
	};
	scope.post_json(params);

}
</script>